package com.simple.microservices.commons.exceptions;


import lombok.Data;

/**
 * @Description 抛出已知 运行时错误统一处理
 * @ClassName KnowExeptions
 * @Auhor huangyangfeng
 * @Date 2019-08-20 16:35
 * @Version 1.0
 */
@Data
public class BusinessException extends RuntimeException {


    /**
     * 错误提示信息
     */
    private String message = "".intern();

    /**
     * 错误的参数代码
     */
    private String code;


    /**
     * 错误的参数代码
     */
    private Boolean result;
    //服务器获取验证码
    private static final String FAILED = "01";
    private static final Boolean NO = Boolean.FALSE;


    public BusinessException(String code, String message) {
        this.code =code;
        this.message =message;
        this.result = NO;

    }

    public BusinessException(String msg) {
        this.code = FAILED;
        this.message = msg;
        this.result = NO;
    }
    public BusinessException() {
        this.code = FAILED;
        this.result = NO;
    }
}
